import {InputNumber, message, Modal, Radio} from 'antd';
import ProForm, {ModalForm} from "@ant-design/pro-form";
import {useState} from "react";

const AddBalance = (props) => {
  const {balance,setBalance} =props;
  const [value,setValue] = useState(1)

  const onChange=(e)=>{
    setValue(e.target.value)
  }
  return (
    <div>
      <ModalForm
        title="修改其他"
        visible={balance}
        onFinish={async () => {
          message.success('提交成功');
          return true;
        }}
        onVisibleChange={setBalance}
      >
        <ProForm.Item>
          <Radio.Group onChange={onChange} value={value}>
            <Radio value={1}>增加</Radio>
            <Radio value={2}>减少</Radio>
          </Radio.Group>
        </ProForm.Item>
        <ProForm.Item
          name="num"
          label="余额"
        >
          <InputNumber min={-100} max={100} defaultValue={3} onChange={()=>{}} />
        </ProForm.Item>

        <ProForm.Item>
          <Radio.Group onChange={onChange} value={value}>
            <Radio value={1}>增加</Radio>
            <Radio value={2}>减少</Radio>
          </Radio.Group>
        </ProForm.Item>
        <ProForm.Item
          name="num"
          label="积分"
        >
          <InputNumber min={-100} max={100} defaultValue={3} onChange={()=>{}} />
        </ProForm.Item>
      </ModalForm>
    </div>
  );
};

export default AddBalance;
